package org.csu.jpetmanage.service.serviceImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.csu.jpetmanage.mapper.BannerdataMapper;
import org.csu.jpetmanage.model.Bannerdata;
import org.csu.jpetmanage.service.BannerdataService;
import org.springframework.stereotype.Service;

@Service
public class BannerdataServiceImpl extends ServiceImpl<BannerdataMapper, Bannerdata> implements BannerdataService {
    @Override
    public Page<Bannerdata> list(Bannerdata bannerdata, long current, long size) {
        QueryWrapper<Bannerdata> queryWrapper = new QueryWrapper<>();
        if (null != bannerdata.getFa()) {
            queryWrapper.eq("fa", bannerdata.getFa());
            queryWrapper.like("ba", bannerdata.getBa());
        }

        return baseMapper.selectPage(new Page<>(current, size), queryWrapper);
    }
}
